package com.example.xw.common.service;

import com.example.xw.common.entity.User;
import com.example.xw.common.service.fallback.FallbackUserServiceImpl;
import com.example.xw.common.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "xw-user",contextId="myUserServiceImpl",fallback = FallbackUserServiceImpl.class)
public interface UserService {
    //注册
    @RequestMapping("/user/reg")
    Result<User> reg(@RequestParam("nickName")String nickname,
                     @RequestParam("loginName")String loginname,
                     @RequestParam("loginPwd")String loginpwd,
                     @RequestParam("photo")String photo);
    //登陆
    @RequestMapping("/user/login")
    Result<User>  login(@RequestParam("loginName")String loginname,@RequestParam("loqinPwd")String loginpwd);
    //添加积分
    @RequestMapping("/user/addScore")
    Result<User>  addScore(@RequestParam("loginname")String loginname, @RequestParam("score")int score);
    //修改状态
    @RequestMapping("/user/updateState")
    Result<User>  updatestate(@RequestParam("Loginname")String loginname,@RequestParam("state")int state);
    //查询用户
    @RequestMapping("/user/getUser")
    Result<User>  getUser(@RequestParam("loginname")String loginname);
    //根据loginname查询用户
    @RequestMapping("/user/getUserByLoginname")
    Result<User>  getUserByLoginname(@RequestParam("loginname")String loginname);
}
